package com.test.controller;


import com.test.common.BaseResponse;
import com.test.common.ResultUtils;
import com.test.model.pojo.MultipleQuestion;
import com.test.service.MultipleQuestionService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ms")
public class MultipleQuestionController {

    @Autowired
    MultipleQuestionService multipleQuestionService;

    @GetMapping("/getCount")
    public Integer getCounts(){
        return multipleQuestionService.getQuestionCounts();
    }


    @GetMapping("/getQuestionById/{id}")
    public BaseResponse<MultipleQuestion> getQuestionById(@PathVariable Integer id){
        if(id==null){
            return null;
        }
        return ResultUtils.success(multipleQuestionService.getQuestionById(id));
    }

}
